package com.errol.generic.file.excel.model;

import com.renjia.service.generic.file.excel.pojo.ValueType;

import java.util.List;

/**
 * Created by Errol on 20/04/24.
 * 导出动态表格时，定义列
 *
 * @author zhang xiao bin
 * @version v1.0
 * @date 2020/10/21
 * @since v4.7.6
 */
public class ExcelDynamicColumn {

    /**
     * 表头名称
     */
    private String title;
    /**
     * 列的数据类型，true 为数字（int），false 为文本
     */
    private ValueType valueType;
    /**
     * 二级列表头，存在 children 则 digital 有效
     */
    private List<ExcelDynamicColumn> children;

    public ExcelDynamicColumn(String title, ValueType valueType) {
        this.title = title;
        this.valueType = valueType;
        this.children = null;
    }

    public ExcelDynamicColumn(String title, List<ExcelDynamicColumn> children) {
        this.title = title;
        this.valueType = ValueType.STRING;
        this.children = children;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ValueType getValueType() {
        return valueType;
    }

    public void setValueType(ValueType valueType) {
        this.valueType = valueType;
    }

    public List<ExcelDynamicColumn> getChildren() {
        return children;
    }

    public void setChildren(List<ExcelDynamicColumn> children) {
        this.children = children;
    }
}
